<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="/js/common_basic.js"></script>
	<script src="/js/utility/common_util.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#keyword").focus();
		});
	
		function openArtistDetail(idx) {
			window.open('/star/starunse/artist_detail?idx='+idx, 'popup', 'width=650, height=650, toolbar=no,directories=no,scrollbars=yes,resizable=no,status=no,menubar=no,top=0,left=0');
		}

		function removePopularStar(idx) {
			if (confirm('삭제?')) {
				document.frm2.artist_idx.value = idx;
				document.frm2.submit();
			}
		}
		
		// 스타 검색 팝업
		function openStarSearch() {
			openPopup("/star/starpt/search", 500, 430);
		}

		
	</script>
</head>
<body>

<form method="post" name="frm2" id="frm2" action="/star/popular/remove_ok">
	<input type="hidden" name="popular_id" value="main_monthly" />
	<input type="hidden" name="artist_idx" />
</form>
<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/header.php'; ?>
	<!--// Header -->
	
	<!-- Contents -->
	<div id="content">
		<h2>이달의 스타 관리 - 리스트</h2>
		<div>
			<table class="basicTable" width="100%" cellpadding="2" cellspacing="1" border="0">
				<thead>
					<tr>
						<th>스타No</th>
						<th>우선순위</th>
						<th>사진</th>
						<th>이름</th>
						<th>보기</th>
						<th>삭제</th>
					</tr>
				</thead>
				<tbody>
<?	foreach ($list as $item) : ?>
					<tr>
						<td align="center"><input type="hidden" name="idx[]" value="<?=$item['idx']?>" /><?=$item['idx']?></td>
						<td align="center"><?=$item['priority']?></td>
						<td align="center"><img src="<?=$item['photo']?>" width="20" height="25" /></td>
						<td align="center"><?=$item['artist_name']?></td>
						<td align="center"><button onclick="openArtistDetail('<?=$item['idx']?>')">보기/수정</button></td>
						<td align="center"><button onclick="removePopularStar('<?=$item['idx']?>')">삭제</button></td>
					</tr>
<?	endforeach ?>
				</tbody>
			</table>
		</div>

		<h2>이달의 스타 등록</h2>
		<div>
			<form method="post" id="frm" action="/star/popular/write_ok">
				<input type="hidden" name="popular_id" value="main_monthly" />
				<fieldset>
					<table class="basicTable" width="100%" cellpadding="2" cellspacing="1" border="0">
						<thead>
							<tr>
								<th>스타검색</th>
								<th>스타No</th>
								<th>이름</th>
								<th>우선순위</th>
							</tr>
						</thead>
						<tr>
							<td align="center"><input type="button" value="검색" onclick="openStarSearch()" /></td>
							<td align="center"><input type="text" name="artist_idx" readonly="readonly" class="roTxt" /></td>
							<td align="center"><input type="text" name="artist_name" readonly="readonly" class="roTxt" /></td>
							<td align="center"><input type="text" name="priority" /></td>
						</tr>
					</table>
					<input type="submit" value="저장" />
				</fieldset>
			</form>	
		</div>
	</div>
	<!--// Contents -->
	
	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/footer.php'; ?>
	<!--// Footer -->
</div>
</body>
</html>